package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import po.User;
import service.UserService;

/**
 * Created by apple on 2017/10/20.
 */

@Controller
public class LoginController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/login.do", produces="text/html;charset=UTF-8")
    //@ResponseBody
    public String login(@RequestParam String username, @RequestParam String password) {
        //System.out.println(username);
        if (userService.loginCheck(username, password)) {
            return "houtai";
        } else
            return "redirect:index.html";
    }
}
